package com.changli.a_Array;

import java.util.Arrays;
import java.util.Scanner;

public class Demo3TestLottery {
    public static void main(String[] args) {
        Scanner sc = new Scanner (System.in);
        //数组的大小，抽取的数字的数量
        int n = sc.nextInt();
        //抽取的数字的多少
        int k = sc.nextInt();

        int [] number = new int[n];

        for(int i=0;i<number.length;i++){
            number[i] = i+1;
        }
        int result [] = new int [k];
        for(int i=0;i<result.length;i++){
            int r = (int)(Math.random()*n);
            result[i] = number[r];
            //防止同一个数字重复被抽到
            number[r] = number[n-1];
            n--;
        }
        //将其排序----默认升序
//        Arrays.sort(result);
        for (int j : result) {
            System.out.println(j);
        }
    }


}
